package ldh.im.handle;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;

public class ExceptionOutHandler extends ChannelOutboundHandlerAdapter {

//    private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionOutHandler.class);

    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        ctx.write(msg, promise);
        promise.addListener(c->{
            if (!c.isSuccess()) {
//                LOGGER.error("发送消息失败", c.cause());
            }
        });
    }
}
